package cn.lzd.mr.case7;

import org.apache.hadoop.io.NullWritable;
import org.apache.hadoop.mapreduce.Partitioner;

/**
 * Created by lzd on 2018/6/5.
 */
public class CustomParition extends Partitioner<Bean2,NullWritable> {
    @Override
    public int getPartition(Bean2 bean2, NullWritable nullWritable, int i) {
        System.out.println("====================================map阶段分区开始-结束====================================");
        return (bean2.getUserid().hashCode() & Integer.MAX_VALUE) % i;
    }
}
